﻿@using KRM.Core

@using KRM.Core.Library
@model KRM.Core.tblEmail
@{
    var db = new KRMEntities();
}
<form action="/EmailTicket/SaveTicket" id="frSaveTicket" method="POST" class="form-horizontal" role="form" enctype="multipart/form-data">
    @Html.ValidationSummary(true)
    <input type="hidden" id="EmailID" name="MailID" value="@Model.EmailID"/>
    <input type="hidden" name="CreatedByUserID" id="UserID" value="@Users.Current(User.Identity.Name).UserID"/>    
    <!-- BEGIN SAMPLE FORM PORTLET-->   
               <div class="portlet box blue ">
                  <div class="portlet-title">
                     <div class="caption">
                        Create Ticket
                     </div>
                  </div>
                  <div class="portlet-body form">
                      <div class="form-body">                     
                         <div class="form-group">
                              <label  class="col-md-3 control-label">Subject</label>
                              <div class="col-md-9">
                                    <input id="Subject" type="text" name="Subject" class="form-control">                                
                              </div>
                           </div>  

                           <div class="form-group">
                              <label  class="col-md-3 control-label">Assign to user</label>
                              <div class="col-md-9">
                                 @Html.DropDownList("AssignedToUserID",null,new {@class="form-control"})
                              </div>
                           </div>   
                           <div class="form-group">
                              <label  class="col-md-3 control-label">Date start</label>
                              <div class="col-md-9">
                                 <div Id="datetimepicker1"class="input-group input-medium date date-picker" data-date="@DateTime.Now" data-date-format="dd/mm/yyyy" data-date-viewmode="years">
                                    <input type="text" name="DateStart" class="form-control" required="required" placeholder="dd/mm/yyyy" value="@DateTime.Now.ToString("dd/MM/yyyy")">
                                    <span class="input-group-btn">
                                        <button class="btn default" type="button"><i class="icon-calendar"></i></button>
                                    </span>
                                </div>
                              </div>
                           </div>      
                          
                           <div class="form-group">
                              <label  class="col-md-3 control-label">Tag
                              </label>
                               <div class="col-md-9">     
                                       <div class="form-control" style="height:100px; overflow: auto">
                                            @foreach (var item in db.tblTags)
                                            {
                                                <div class="control" style="margin-left:10px;">
                                                    <label class="checkbox">
                                                        <input type="checkbox" name="Tag@(item.TagID)" value="@item.TagID"/>
                                                        @item.Tag
                                                    </label>
                                                </div>
                                            }
                                        </div>
                               </div> 
                           </div>  
                           <div class="form-group">
                              <label  class="col-md-3 control-label">Description</label>
                              <div class="col-md-9">
                                 <textarea class="form-control" rows="5" id ="Description" name ="Description"></textarea>
                                  </div>
                               </div>
                           </div>
                      </div>
                   
                   </div>
    
                     
                  
               <!-- END SAMPLE FORM PORTLET-->



    <div class="modal-footer">        
        <button class="btn btn-default" data-dismiss="modal" aria-hidden="true">Close</button>        
        <button type="submit" id="btnAccept" class="btn btn-primary"onclick="">Create</button>
    </div>
</form>
